Web pages are created using a markup language that describes the structure of information in the page and can include interactive forms, embedded images, and other objects. The markup language can include embedded scripts (e.g., JAVASCRIPT code) which can affect the behavior of objects on the page. JAVASCRIPT, for example, provides developers with the ability to add event handlers to specific objects in a web page that respond to certain types of input events. Often, developers use the scripts to create event handlers for mouse events, such as mouse down or mouse up events indicating when a mouse button is pressed down or released. Thus, a user of an electronic device can use a mouse to interact with the web page.
Many recent types of electronic devices rely on touch-sensitive displays for user input instead of a mouse. The user uses a finger, stylus, or other object to interact with the web page. Typically, the electronic device will send these interactions to a web browser as touch events. If the scripts within a web page rendered by the browser are configured to receive only mouse events, the scripts will not process the touch events.
To remedy this problem, some electronic devices convert touch events to mouse events and send both types of events to the browser. However, touch events do not necessarily correlate with mouse events and this form of simple translation can have unintended consequences. Certain gestures, such as double-tap to zoom the page, delay the sending of mouse events to the browser because mouse events are not generated in the case of zooming the page. Consequently, the browser does not send mouse events corresponding to the first tap, until it identifies that the tap is not part of a double-tap. The browser accomplishes this by waiting for a second tap in a double-tap. Such anticipation of a second tap in a double-tap typically generates a lag time between the user's input and execution of an action in the web page. The wait can also result in multiple mouse events being sent to the browser in rapid succession once the device identifies the touch event. As a result, the user's interactions with the web page may feel sluggish or non-responsive.